<?php slot('theme','now'); ?>
<div class="W100p mainptn">
	<div class="Cw1280">
        <!--成长烦恼-->
        <div class="Czfn_div" style="width:860px;">
            <div class="Htbanner"><a href=""><img src="<?php image_path('img14.jpg'); ?>" width="860" height="210"></a></div>
            <?php include_component('article', 'recommend'); ?>
            
            <div class="zxhtitle">
            	<h1>最新话题</h1>
                <h2>最新主题 <span><?php echo TalkThemeTable::countDisplayTheme(); ?></span></h2>
                <h2>推荐 <span><?php echo TalkThemeTable::countRecommendTheme(); ?></span></h2>
            </div>
            <?php foreach($pager->getResults() as $theme): ?>
            <div class="zxhtlist">
            	<div class="zxhtlistpto"><img src="<?php echo $theme->getUser()->getCover('themeusercover'); ?>" width="48" height="48"></div>
                <div class="zxhtlistc">
                	<div class="DetitleCt" style="padding-top:0px;"><a href="<?php echo url_for('theme/show?id='.$theme->getId()); ?>"><?php echo $theme->getTitle(); ?></a></div>
                    <div class="zxhtlistcdiv">
                        <?php if($theme->getHasCover()): ?>
                    	<img src="<?php echo $theme->getThumbCover('themelistcover'); ?>" width="150" height="85">
                        <?php endif; ?>
                        <p>
                            <?php if(mb_strwidth(strip_tags($theme->getRaw('content')),'UTF8') > 80 && $theme->getHasCover() == 1): ?>
                            <?php echo mb_strimwidth(strip_tags($theme->getRaw('content')), 0, (3*70), '.........', 'UTF8'); ?>
                            <?php elseif(mb_strwidth(strip_tags($theme->getRaw('content')),'UTF8') > 105 && $theme->getHasCover() == 0) : ?>
                            <?php echo mb_strimwidth(strip_tags($theme->getRaw('content')), 0, (3*100), '.........', 'UTF8'); ?>
                            <?php else: ?>
                            <?php echo strip_tags($theme->getRaw('content')); ?>
                            <?php endif; ?>
                        </p>
                    </div>
                    <div class="zxhtfrom">
                    	<h1>来自 <a href="<?php echo url_for('theme/group?id='.$theme->getGroup()->getId()); ?>"><?php echo $theme->getGroup()->getName(); ?>小组</a> <?php echo $theme->getTimeAgoToString(); ?></h1>
                        <h2><span class="lk"><?php echo $theme->getAttr()->getReadNum(); ?></span><span class="ly"><?php echo $theme->getAttr()->getCommentNum(); ?></span></h2>
                    </div>
                </div>
            </div>
           <?php endforeach; ?>
<?php echo pager_navigation_theme($pager, 'theme/index',4); ?>
            
<!--            <div class="zxhtpage"><a href=""><</a><a href="">1</a><a href="">2</a><a href="" class="n">3</a><a href="">4</a><a href="">...</a><a href="">></a></div>-->
        </div>
        
        <!--右边-->
        <div class="DeRight" style="width:360px;">
        	<style>
			.xzxxti {border-bottom:1px solid #ccc; padding-bottom:20px;}
			</style>
        	<div class="Detitle2" style="margin-top:0px;"><h1>值得加入的小组</h1><h3><a href="javascript:void(0);" id='next'>换一批</a></h3></div>
                <div id='next_div'>
<?php if($sf_user->isAuthenticated()): ?>
        <?php include_component('theme', 'login_recommend_group'); ?>        
<?php else: ?>
       <?php include_component('theme', 'nologin_recommend_group'); ?>         
<?php endif; ?>
        	</div>
            <div class="xztotal">
                <h1><span><?php echo JgroupTable::getInstance()->count(); ?></span><br />小组创建总数</h1>
                <h2><span><?php echo TalkThemeTable::countTodayTheme(); ?></span><br />今日话题总数</h1>
                <h3><span><?php echo ThemeCommentTable::countDisplayComment(); ?></span><br />话题评论总数</h1>
                <h4><span><?php echo TalkThemeTable::countYesterdayTheme(); ?></span><br />昨日话题总数</h1>
            </div>
            
        </div>
        
    </div>
</div>
<script type="text/javascript">
$(document).ready(function(){
    $("#next").click(function(){
        $.get('theme/recommend_group',{},function(html){
            $("#next_div").html(html);
        });
    });
});
</script>